PROJECT(BITFETCHTABLE)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_SYSTEM_NAME Linux)

#EXECUTE_PROCESS(COMMAND protoc -I=${CMAKE_CURRENT_SOURCE_DIR} --cpp_out=${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/message_struct.proto)

list(APPEND BITFETCHTABLE_SOURCE_DIR 
    ${CMAKE_CURRENT_SOURCE_DIR}
)

list(APPEND BITFETCHTABLE_SOURCE_FILE
    ${CMAKE_CURRENT_SOURCE_DIR}/src/bithashtablehandle.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/src/bittablejni.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/src/bittablemanager.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/src/diskbittable.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/src/hashablestring.cc
    ${CMAKE_CURRENT_SOURCE_DIR}/src/membittable.cc

)

list(APPEND BITFETCHTABLE_TARGET_INCLUDE_DIRECTORIES
    ${CMAKE_CURRENT_SOURCE_DIR}/src/bithashtablehandle.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/bittable.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/bittablemanager.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/com_bft_BitFetchTable.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/diskbittable.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/hashable.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/hashablestring.h
    ${CMAKE_CURRENT_SOURCE_DIR}/src/membittable.h
)

ADD_LIBRARY(bitfetchtable SHARED ${BITFETCHTABLE_SOURCE_FILE})
SET_TARGET_PROPERTIES(bitfetchtable PROPERTIES VERSION 1.1 SOVERSION 1)

INSTALL(TARGETS bitfetchtable
    LIBRARY DESTINATION lib)

INSTALL( FILES ${BITFETCHTABLE_TARGET_INCLUDE_DIRECTORIES}
    DESTINATION include/bitfetchtable)

list(APPEND BITFETCHTABLE_LIBRARIES
    bitfetchtable
)


